def checkPassword(password):
    if(password == None):
        return False
    if(len(password)>16 or len(password)<6):
        return False
    hasNumber = False
    hasSmallLetter = False
    hasBigLetter = False
    hasSpecialChar = False
    arr = '~@#$%*_-+=:.?'
    for c in password:
        if '0'<=c<='9':
            hasNumber = True
        elif 'a'<=c<='z':
            hasSmallLetter = True
        elif 'A'<=c<='Z':
            hasBigLetter = True
        elif c in arr:
            hasSpecialChar = True
        else:
            return False
    return hasNumber and hasSmallLetter and hasBigLetter and hasSpecialChar 

#测试用例分别为：长度不够，完全符合，含有无效字符，长度过长，不含数字，不含小写字母，不含大写字母，不含特殊字符
passwords = ['aA1#a','AAA123__a','adasd1AS$$\\','asd232ASD&&asdqwasfa2','asdadASD$%','123ASD$$$$','123asd&&$','123qweASD']
for s in passwords:
    print(checkPassword(s))
 